package com.YCH.model.mappers.app;

import com.YCH.model.behavior.pojos.TbCollectionBehavior;
import com.YCH.model.behavior.pojos.TbLikesBehavior;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface TbCollectionBehaviorMapper {
    /**
     * 选择一个终端的收藏数据
     * @return
     */
    TbCollectionBehavior selectForUserId(@Param("userId")Long userId, @Param("articleId")Long articleId, @Param("type") Short type);

    /**
     * 查询收藏人数
     * @param articleId
     * @param type
     * @return
     */
    Integer selectCollectionCount(@Param("articleId")Long articleId, @Param("type") Short type);

    /**
     * 收藏接口
     * @param record
     * @return
     */
    int insert(TbCollectionBehavior record);

    /**
     * 取消收藏
     * @return
     */
    Integer updata(TbCollectionBehavior record);

    List<Long> selectArticleIdByUserIdAndOperation(@Param("userId") Long userId,@Param("operation") short operation);
}